﻿#region 命名空间

using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sharp.Domain.PlatformBoundedContext.MasterDataModule.Aggregates;


#endregion

namespace Sharp.Domain.PlatformBoundedContext.ModelConfigurations
{
    public sealed partial class MasterDataTypeConfiguration : EntityTypeConfiguration<MasterData>
    {
        public MasterDataTypeConfiguration()
        {
            Config();
        }

        #region 通用配置

        public void Config()
        {
          
            Property(c => c.Id)
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(c => c.Name)
                .IsRequired()
                .HasMaxLength(50);
            Property(c => c.Code)
                .IsRequired()
                .HasMaxLength(50);


            Property(c => c.FullName)
                .IsOptional()
                .HasMaxLength(255);

            Property(c => c.ParentCode)
                .HasMaxLength(50)
                .IsOptional();


        }

        #endregion
    }
}